﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Drawing;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for BodyTest and is intended
    ///to contain all BodyTest Unit Tests
    ///</summary>
    [TestClass()]
    public class BodyTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Body Constructor
        ///</summary>
        [TestMethod()]
        public void BodyConstructorTest() {
            Body target = new Body();
            Assert.AreEqual("<body></body>", target.ToString());
        }

        /// <summary>
        ///A test for ALink
        ///</summary>
        [TestMethod()]
        public void ALinkTest() {
            Body target = new Body();
            Nullable<Color> expected = Color.Red;
            Nullable<Color> actual;
            target.ALink = expected;
            actual = target.ALink;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for BGColor
        ///</summary>
        [TestMethod()]
        public void BGColorTest() {
            Body target = new Body();
            Nullable<Color> expected = Color.Red;
            Nullable<Color> actual;
            target.BGColor = expected;
            actual = target.BGColor;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Background
        ///</summary>
        [TestMethod()]
        public void BackgroundTest() {
            Body target = new Body();
            string expected = string.Empty;
            string actual;
            target.Background = expected;
            actual = target.Background;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Link
        ///</summary>
        [TestMethod()]
        public void LinkTest() {
            Body target = new Body();
            Nullable<Color> expected = Color.Red;
            Nullable<Color> actual;
            target.Link = expected;
            actual = target.Link;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Text
        ///</summary>
        [TestMethod()]
        public void TextTest() {
            Body target = new Body();
            Nullable<Color> expected = Color.Red;
            Nullable<Color> actual;
            target.Text = expected;
            actual = target.Text;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for VLink
        ///</summary>
        [TestMethod()]
        public void VLinkTest() {
            Body target = new Body();
            Nullable<Color> expected = Color.Red;
            Nullable<Color> actual;
            target.VLink = expected;
            actual = target.VLink;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            Body body = new Body();
            body.ALink = Color.Red;
            body.Background = "url";
            body.BGColor = Color.White;
            body.Link = Color.Blue;
            body.Text = Color.Black;
            body.VLink = Color.Green; // #008000, not #00FF00
            Assert.AreEqual("<body alink=\"#FF0000\" " +
                "background=\"url\" " +
                "bgcolor=\"#FFFFFF\" " +
                "link=\"#0000FF\" " +
                "text=\"#000000\" " +
                "vlink=\"#008000\"></body>", body.ToString());
        }
    }
}
